use iced::{pane_grid, Application, Container, Element, PaneGrid, Row, Settings, Text, TextInput};
use iced_native::executor::ThreadPool;
use iced_native::{Command, Length};

mod content;
mod list;

fn main() {
    pretty_env_logger::init_timed();

    App::run(Settings::default());
}

#[derive(Default)]
struct App {
    dirs: Vec<String>,
}

#[derive(Debug)]
enum AppMsg {
    Select(String),
    Search(String),
    Resized(usize),
}

impl Application for App {
    type Executor = ThreadPool;
    type Message = AppMsg;
    type Flags = ();

    fn new(flags: Self::Flags) -> (Self, Command<Self::Message>) {
        (App::default(), Command::none())
    }

    fn title(&self) -> String {
        String::from("Log viewer")
    }

    fn update(&mut self, message: Self::Message) -> Command<Self::Message> {
        unimplemented!()
    }

    fn view(&mut self) -> Element<'_, Self::Message> {
        let row = Row::new()
            .width(Length::Fill)
            .height(Length::Fill)
            .spacing(10);

        for dir in self.dirs {
            row.push()
        }

        Container::new(row)
            .width(Length::Fill)
            .height(Length::Fill)
            .padding(10)
            .into()
    }
}
